﻿using System;
using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace IRepository.Migrations
{
    public partial class _2 : Migration
    {
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.CreateTable(
                name: "Goods",
                columns: table => new
                {
                    GoodsId = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    GoodsName = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    IsDel = table.Column<bool>(type: "bit", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_Goods", x => x.GoodsId);
                });

            migrationBuilder.CreateTable(
                name: "T_Goods",
                columns: table => new
                {
                    Goods_Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    Goods_Name = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: false),
                    Goods_Price = table.Column<decimal>(type: "decimal(18,2)", nullable: false),
                    Goods_Img = table.Column<string>(type: "nvarchar(300)", maxLength: 300, nullable: false),
                    Goods_State = table.Column<bool>(type: "bit", nullable: false),
                    Goods_Remark = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: false),
                    GoodsId = table.Column<int>(type: "int", nullable: false),
                    GoodsType_Id = table.Column<int>(type: "int", nullable: false),
                    Goods_Create = table.Column<DateTime>(type: "datetime2", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_T_Goods", x => x.Goods_Id);
                });

            migrationBuilder.CreateTable(
                name: "T_GoodsType",
                columns: table => new
                {
                    GoodsType_Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    GoodsType_Name = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    GoodsType_ParentId = table.Column<int>(type: "int", nullable: false),
                    GoodsType_IsDelete = table.Column<bool>(type: "bit", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_T_GoodsType", x => x.GoodsType_Id);
                });
        }

        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropTable(
                name: "Goods");

            migrationBuilder.DropTable(
                name: "T_Goods");

            migrationBuilder.DropTable(
                name: "T_GoodsType");
        }
    }
}
